const Router = require('koa-router')


const router = new Router({
  prefix:'/sjj'
})

// 登录
router.get('/login', async (ctx, next) => {

  // body: ctx.request.body,
  // query: ctx.request.query, // get传参
  // path: ctx.params,
  // header: ctx.request.header
  // console.log(ctx.request.query)

  ctx.body = {
    code: 200,
    message: "调用成功。",
    result: "ml:0:sjj:bb9344c1806048f7b7bb45082c044b55"
  }
})
// 获取用户信息
router.get('/getInfo', async (ctx, next) => {
  ctx.body = {
    code: 200,
    message: "调用成功。",
    result: {
      adminId: 166,
      code: "",
      companyId: 0,
      createTime: null,
      department: 97,
      departmentName: null,
      email: "1111111@163.com",
      gender: 1,
      genderName: null,
      job: 19,
      jobName: null,
      lastUpdateTime: null,
      loginIP: "192.168.0.13",
      realName: "sjj",
      status: 1,
      tel: "11111111111",
      userName: "sjj",
      roleList: [
        {
          adminVoList: null,
          roleId: 80,
          roleNo: "roleNo",
          seq: 100,
          status: null,
          title: "研发部",
          userCount: 0,
          createTime: "2019-05-15T02:08:00.000+0000",
          description: "这是一条专业的角色描述",
          authList: [29, 30, 31, 32, 33, 34, 36, 37, 103, 104, 105, 106, 107, 121, 98, 99, 93, 35, 14, 15, 16, 17, 18, 19],
          pageAuth: "1,1-1,1-2,2,2-1,2-1-1,2-1-1-1,2-1-1-2,2-1-1-3,2-1-2,2-1-3,2-1-5,2-1-8,2-1-6,2-1-4,2-1-7,2-2,2-2-1,2-2-5,2-2-2,2-2-3,2-2-6,2-2-4,2-3,2-3-1,2-3-1-1,2-3-1-2,2-3-2,2-3-2-1,2-3-2-2,2-3-2-3,2-3-2-4,2-3-3-5,2-3-3-6,2-3-3-7,2-3-3,2-3-3-1,2-3-3-2,2-3-3-3,2-3-4,2-4,2-4-1,2-4-2,2-4-3,5,5-1,5-1-1,5-1-7,5-1-5,5-1-6,5-1-2,5-1-3,5-1-8,5-1-9,5-1-4,5-2,5-2-1,5-2-2,5-2-4,5-2-3,5-2-8,5-2-9,5-2-10,7,7-1,7-1-1,7-1-3,7-1-4,7-2,7-2-1,7-2-3,7-2-4,7-3,7-3-1,7-3-2,3,3-1,3-1-1,3-1-2,3-1-3,3-1-10,3-1-5,3-1-11,3-1-9,3-1-6,3-1-7,3-1-8,3-2,3-2-1,3-2-2,3-2-3,3-1-4,3-2-5,3-2-11,3-2-4,3-2-6,3-2-7,3-2-8,3-3,3-3-1,3-3-2,3-4,3-4-1,3-4-2,3-4-3,3-5,3-5-1,3-5-2,3-5-3,3-6,3-6-1,3-7,3-8,3-9,3-10,9,9-1,9-1-2,9-1-1,9-1-3,9-1-4,9-3,9-3-1,9-3-2,9-3-3,10,10-1,10-1-1,10-1-2,10-1-3,6,6-1,6-1-1,6-1-2,6-1-3,6-1-4,6-2,6-2-1,6-2-2,6-2-3,6-2-4,6-3,6-3-1,6-4,6-4-1,6-4-2,8,8-2,8-2-1,8-2-3,8-2-4,4,4-1,4-1-1,4-2,4-2-1,4-2-2,4-2-3,4-2-4,4-3,4-3-1,4-3-2,4-3-3,4-4,4-4-1,11,11-1,11-1-1,11-2,11-2-1"
        }
      ]
    }
  }
})

// 退出
router.post('/logout', async (ctx, next) => {
  ctx.body = {
    "code": 200,
    "message": "调用成功。"
  }
})

module.exports = router